/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.xtandemparser.xmlreader;

import com.compomics.xtandemparser.xmlreader.operations.indexer.RAFIndexer;
import com.compomics.xtandemparser.xmlreader.operations.parser.options.XMLPARSINGOPTION;
import com.compomics.xtandemparser.xmlreader.operations.parser.handler.PeptideHandler;
import com.compomics.xtandemparser.xmlreader.operations.parser.XmlParser;
import com.compomics.xtandemparser.xmlreader.operations.xmlextractor.XmlExtractor;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.log4j.Logger;

/**
 *
 * @author Kenneth
 */
public class Example {

    private static File xmlFile = new File("C:\\Users\\Kenneth\\Documents\\NetBeansProjects\\xTandemParser\\src\\resources\\3643.t.xml");
    private static final Logger logger = Logger.getLogger(Example.class);

    public static void main(String args[]) {
        try {
            RAFIndexer.makeIndices(xmlFile);
            ArrayList<Long> indices = RAFIndexer.getPeptideIndices();
            long startingPosition = indices.get(0);
            String xmlString = new XmlExtractor(xmlFile).getXMLEntry(startingPosition, XMLPARSINGOPTION.PEPTIDE);
            XmlParser.parse(xmlString,new PeptideHandler());
            
        } catch (FileNotFoundException ex) {
            logger.error(ex);
        } catch (IOException ex) {
            logger.error(ex);
        }
    }
}
